package com.cdream.basic.mybatisplus.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.cdream.basic.mybatisplus.dao.User;
import com.cdream.basic.mybatisplus.mapper.UserMapper;
import com.cdream.basic.mybatisplus.service.UserService;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;

@Service
public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements UserService {
    @Override
    @Cacheable(value = "user", key = "#id")
    public User getByIdWithCache(Long id){
        return getById(id);
    }
}
